<div class="SipeiMain_r fr">
    <h2 class="clearfix fonts_18 height45 fontc_444"><?php echo $this->title; ?></h2>
    <div class="clearfix back_bgf border_3 border_c pr30 pl30 pt20 pb20 height32 fontc_666">
        <form action="" method="POST"  id='searchForm'>
            <ul class="clearfix">
                <li class="fl pt10 pr30 pb10">
                    <span class="fl pr3 text_align" style="width:63px;">考试项目：</span>
                    <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                        <span class="fl select_shelter"> 
                            <select class="fl fontc_666" name="exam_id" onchange="checkschoolsubjec(this.value)">
                                <option value="">请选择</option>
                                <?php foreach ($date['ztask'] as $v): ?>
                                    <option value="<?php echo $v['exam_id']; ?>" <?php
                                    if ($info['exam_id'] == $v['exam_id']) {
                                    	echo "selected=selected";
                                    }
                                    ?> ><?php echo $v['exam_term_name']; ?></option>
                                        <?php endforeach; ?>
                            </select> 
                        </span> 
                    </span>
                </li>
                <li class="fl pt10 pr30 pb10">
                    <span class="fl pr3 text_right" style="width:85px;">所属学校：</span>
                    <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                        <span class="fl select_shelter"> 
                            <select class="fl fontc_666" name="school_id" id="schools">
                                <option value="0">请选择</option>
                                <?php foreach ($date['school'] as $v): ?>
                                    <option value="<?php echo $v['school_id']; ?>" <?php
                                    if (isset($info['school_id'])){
                                    	if ($info['school_id'] == $v['school_id']) {
                                    		echo "selected=selected";
                                    	}
                                    }
                                    ?> ><?php echo $v['school_name']; ?></option>
                                        <?php endforeach; ?>
                            </select> 
                        </span> 
                    </span>
                </li>
                <li class="fl pt10 pr30 pb10">
                    <span class="fl pr3 text_align" style="width:63px;">类别：</span>
                    <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                        <span class="fl select_shelter"> 
                            <select class="fl fontc_666" name="disciplin_id">
								<option value="0">请选择</option>
                                <option value="1" <?php
                                if ($info['disciplin_id'] == 1) {
                                	echo "selected=selected";
                                }
                                ?> >理科</option>
                                <option value="2" <?php
                                if ($info['disciplin_id'] == 2) {
                                	echo "selected=selected";
                                }
                                ?> >文科</option>
                                <option value="3" <?php
                                if ($info['disciplin_id'] == 3) {
                                	echo "selected=selected";
                                }
                                ?> >艺体</option>
                            </select> 
                        </span> 
                    </span>
                </li>
				<!--<li class="fl pt10 pr30 pb10">
                    <span class="fl pr3 text_right" style="width:85px;">所属科目：</span>
                    <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                        <span class="fl select_shelter"> 
                            <select class="fl fontc_666"  name="subject_id" id="subjects">
                                <option value="0">请选择</option>
                                <?php foreach ($date['subject'] as $k => $v): ?>
                                    <option value="<?php echo $k; ?>" <?php
                                    if (isset($info['subject_id'])){
                                    	if ($info['subject_id'] == $k) {
                                    		echo "selected=selected";
                                    	}
                                    }
                                    ?> ><?php echo $v; ?></option>
                                        <?php endforeach; ?>
                            </select> 
                        </span> 
                    </span>
                </li>-->
				
                <li class="fl pt10 pr30 pb10">
                    <span class="fl pr3 text_right" style="width:85px;">所属科别：</span>
                    <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                        <span class="fl select_shelter"> 
                            <select class="fl fontc_666"  name="disciplin_code" id="subjects">
                                <option value="0">请选择</option>
								<?php if(!empty($date['disciplin'])):?>
                                <?php foreach ($date['disciplin'] as $k => $v): ?>
                                    <option value="<?php echo $v['disciplin_id']; ?>" <?php
                                    if (isset($info['disciplin_code'])){
                                    	if ($info['disciplin_code'] == $v['disciplin_id']) {
                                    		echo "selected=selected";
                                    	}
                                    }
                                    ?> ><?php echo $v['disciplin_nick']; ?></option>
                                        <?php endforeach; ?>
										<?php endif; ?>
                            </select> 
                        </span> 
                    </span>
                </li>
                <li class="fl pt10 pr30 pb10">
                    <span class="fl pr3 text_align" style="width:63px;">所属班级：</span>
                    <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                        <span class="fl select_shelter"> 
                            <select class="fl fontc_666" name="class_name">
                                <option value="0">请选择</option>
                                <?php foreach ($date['class'] as $v): ?>
                                    <option value="<?php echo $v['class_name']; ?>" <?php
                                    if ($info['class_name'] == $v['class_name']) {
                                    	echo "selected=selected";
                                    }
                                    ?> ><?php echo $v['class_name']; ?></option>
                                        <?php endforeach; ?>
                            </select> 
                        </span> 
                    </span>
                </li>
                <li class="fl pt10 pr30 pb10">
                    <span class="fl pr3 text_right" style="width:85px;">导出数据范围：</span>
                    <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                        <span class="fl select_shelter"> 
                            <select class="fl fontc_666" name="nojoinstatus">
                                <option value="">所有学生数据</option>
                                <option value="T" <?php
                                if ($info['nojoinstatus'] == 'T') {
                                	echo "selected=selected";
                                }
                                ?> >参加统计学生数据</option>
                                <option value="F" <?php
                                if ($info['nojoinstatus'] == 'F') {
                                	echo "selected=selected";
                                }
                                ?>>不参加统计学生数据</option>
                                <option value="Y"  <?php
                                if ($info['nojoinstatus'] == 'Y') {
                                	echo "selected=selected";
                                }
                                ?>>参加考试学生数据</option>
                                <option value="N"  <?php
                                if ($info['nojoinstatus'] == 'N') {
                                	echo "selected=selected";
                                }
                                ?>>未参加考试学生数据</option>
                            </select> 
                        </span> 
                    </span>
                </li>
            </ul>
            <div class="clearfix pt10 pb10 text_align">
                <input type="submit" onclick="changeGet();" value="查询" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 mr10 cursor" />
                <input type="submit" value="导出" name="import" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor" />
            </div>
        </form> 
    </div>
    <div class="clearfix back_bgf border_c mt15 pt20 pb20">
        <form>
            <table class="height40">
                <thead class="back_bgf5 fontc_666">
                    <tr>
                        <th width="139" align="center" class="m_hr_t m_hr_b">准考号</th>
                        <th width="253" align="center" class="m_hr_t m_hr_b pl30">姓名</th>
                        <th width="230" align="center" class="m_hr_t m_hr_b">学校</th>
                        <th width="140" align="center" class="m_hr_t m_hr_b pl20">班级</th>
                    </tr>
                </thead>
                <tbody class="fontc_444">
                    <?php if (!empty($data)): ?>
                        <?php foreach ($data as $value): ?>
                            <?php if (!empty($value['student_name']) || !empty($value['school_name']) || !empty($value['class_name'])): ?>
                                <tr>
                                    <td align="center" class="m_hr_b"><?php echo $value['exam_code']; ?></td>
                                    <td align="center" class="m_hr_b pl30"><?php echo $value['student_name']; ?></td>
                                    <td align="center" class="m_hr_b pl30"><?php echo $value['school_name']; ?></td>
                                    <td align="center" class="m_hr_b pl30"><?php echo $value['class_name']; ?></td>
                                </tr>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    <?php else: ?>
                        <tr>
                            <td colspan="4"><h1 align="center">暂无数据</h1></td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </form>
        <?php $this->renderPartial('//partial/partial_pager', array('pages' => $pages, "url" => $pageUrl)); ?>
    </div>
</div>
<script>
function checkschoolsubjec(val){
	if(val!=''){
		$.post('/export/results/getexam', {id: val}, function(result) {
			var dataObj=eval("("+result+")");//转换为json对象
			var schoolstr = "<option value='0'>请选择</option>";
			$.each(dataObj.school,function(i,item){
				schoolstr += "<option value='" + item.school_id + "'>" + item.school_name + "</option>"
			})
			$("#schools").html(schoolstr);
			var subjectstr = "<option value='0'>请选择</option>";
			$.each(dataObj.suject,function(i,item){
				subjectstr += "<option value='" + item.subject_id + "'>" + item.subject_name + "</option>"
			})
			$("#subjects").html(subjectstr);
		})
	}
}
function changeGet(){
	$("#searchForm").attr('method','get');
	
}
</script>